# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 57
n 57(None)[del _[1]
for self.filters in self.names:
]:
	i: 0(AF), 35()
	o: 

nname: 35
n 35(None)[for n in self.names:
]:
	i: 0(for)
	o: 57()

nname: 0
n 0(None)[self.names = name.split('|')
]:
	i: 
	o: 35(for), 57(AF)

self.nodes: {0: <unpyclib.structure.node instance at 0xb762ea0c>, 57: <unpyclib.structure.node instance at 0xb762e7ac>, 35: <unpyclib.structure.node instance at 0xb762e72c>}
nname: 44
n 44(None)[return 0
]:
	i: 0(AL), 43()
	o: 

nname: 43
n 43(None)[]:
	i: 3(AF), 39()
	o: 44()

nname: 39
n 39(None)[]:
	i: 13(f), 31()
	o: 43()

nname: 31
n 31(None)[return 1
continue
]:
	i: 13(t)
	o: 39()

nname: 13
n 13(f.filter(record))[for f in self.filters:
]:
	i: 3(for)
	o: 31(t), 39(f)

nname: 3
n 3(None)[]:
	i: 0(loop)
	o: 13(for), 43(AF)

nname: 0
n 0(None)[]:
	i: 
	o: 3(loop), 44(AL)

nname: 44
n 44(None)[return 0
]:
	i: 0(AL), 3(AF), 13()
	o: 

nname: 13
n 13(None)[for f in self.filters:
if f.filter(record):
	return 1
	continue
]:
	i: 3(for)
	o: 44()

nname: 3
n 3(None)[]:
	i: 0(loop)
	o: 13(for), 44(AF)

nname: 0
n 0(None)[]:
	i: 
	o: 3(loop), 44(AL)

nname: 13
n 13(None)[for f in self.filters:
	if f.filter(record):
		return 1
		continue
return 0
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[]:
	i: 
	o: 13(for)

nname: 0
n 0(None)[for f in self.filters:
	if f.filter(record):
		return 1
		continue
return 0
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762ea0c>}
nname: 6
n 6(None)[def __init__(self, name):
	self.names = name.split('|')

def filter(self, record):
	for f in self.filters:
		if f.filter(record):
			return 1
			continue
	return 0

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb762ab6c>}
nname: 50
n 50(None)[]:
	i: 0(AL), 49()
	o: 

nname: 49
n 49(None)[]:
	i: 15(AF), 31()
	o: 50()

nname: 31
n 31(None)[for h in logging.getLogger().handlers:
h.filters = [f]
]:
	i: 15(for)
	o: 49()

nname: 15
n 15(None)[]:
	i: 0(loop)
	o: 31(for), 49(AF)

nname: 0
n 0(None)[f = MultiFilter(name)
]:
	i: 
	o: 15(loop), 50(AL)

nname: 50
n 50(None)[]:
	i: 31()
	o: 

nname: 31
n 31(None)[for h in logging.getLogger().handlers:
	h.filters = [f]
]:
	i: 0(for)
	o: 50()

nname: 0
n 0(None)[f = MultiFilter(name)
]:
	i: 
	o: 31(for)

nname: 50
n 50(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[f = MultiFilter(name)
for h in logging.getLogger().handlers:
	h.filters = [f]
]:
	i: 
	o: 50()

nname: 0
n 0(None)[f = MultiFilter(name)
for h in logging.getLogger().handlers:
	h.filters = [f]
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762ac2c>}
nname: 32
n 32(None)[pdb.set_trace()
]:
	i: 23(), 31()
	o: 

nname: 31
n 31(None)[]:
	i: 0&7&15(f)
	o: 32()

nname: 23
n 23(None)[]:
	i: 0&7&15(t)
	o: 32()

nname: 0&7&15
n 0&7&15(not force and (not DEBUG_MODE or not log_level))[]:
	i: 
	o: 23(t), 31(f)

nname: 0&7&15
n 0&7&15(None)[if not force and (not DEBUG_MODE or not log_level):
	pass
pdb.set_trace()
]:
	i: 
	o: 

self.nodes: {'0&7&15': <unpyclib.structure.node instance at 0xb762a66c>}
nname: 24
n 24(None)[traceback.print_stack(limit=limit)
]:
	i: 15(), 23()
	o: 

nname: 23
n 23(None)[]:
	i: 0&7(f)
	o: 24()

nname: 15
n 15(None)[]:
	i: 0&7(t)
	o: 24()

nname: 0&7
n 0&7(not DEBUG_MODE or not log_level)[]:
	i: 
	o: 15(t), 23(f)

nname: 0&7
n 0&7(None)[if not DEBUG_MODE or not log_level:
	pass
traceback.print_stack(limit=limit)
]:
	i: 
	o: 

self.nodes: {'0&7': <unpyclib.structure.node instance at 0xb762abcc>}
nname: 0
n 0(None)[self._proxy_obj_ = obj
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76308cc>}
nname: 38
n 38(None)[return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)
]:
	i: 14(), 37()
	o: 

nname: 37
n 37(None)[]:
	i: 0&6(f)
	o: 38()

nname: 14
n 14(None)[log.warning('  ** self.%s.%s', attr, name)
]:
	i: 0&6(t)
	o: 38()

nname: 0&6
n 0&6(DEBUG_MODE and not CALLS_ONLY)[]:
	i: 
	o: 14(t), 37(f)

nname: 0&6
n 0&6(None)[if DEBUG_MODE and not CALLS_ONLY:
	log.warning('  ** self.%s.%s', attr, name)
return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)
]:
	i: 
	o: 

self.nodes: {'0&6': <unpyclib.structure.node instance at 0xb7630cec>}
nname: 119
n 119(None)[return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)
]:
	i: 87(), 118()
	o: 

nname: 118
n 118(None)[]:
	i: 0(f)
	o: 119()

nname: 87
n 87(None)[log.warning('  ** self.%s(%s)', attr, ', '.join(params))
]:
	i: 53(), 86()
	o: 119()

nname: 86
n 86(None)[]:
	i: 47(f)
	o: 87()

nname: 53
n 53(None)[params.extend(<genexpr>(kw.items()))
]:
	i: 47(t)
	o: 87()

nname: 47
n 47(kw)[]:
	i: 19(), 46()
	o: 53(t), 86(f)

nname: 46
n 46(None)[]:
	i: 6(f)
	o: 47()

nname: 19
n 19(None)[params.extend(<genexpr>(args))
]:
	i: 6(t)
	o: 47()

nname: 6
n 6(args)[params = []
]:
	i: 0(t)
	o: 19(t), 46(f)

nname: 0
n 0(DEBUG_MODE)[]:
	i: 
	o: 6(t), 118(f)

nname: 119
n 119(None)[return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)
]:
	i: 87(), 0(f)
	o: 

nname: 87
n 87(None)[log.warning('  ** self.%s(%s)', attr, ', '.join(params))
]:
	i: 6()
	o: 119()

nname: 6
n 6(None)[params = []
if args:
	params.extend(<genexpr>(args))
if kw:
	params.extend(<genexpr>(kw.items()))
]:
	i: 0(t)
	o: 87()

nname: 0
n 0(DEBUG_MODE)[]:
	i: 
	o: 6(t), 119(f)

nname: 119
n 119(None)[return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)
]:
	i: 6(), 0(f)
	o: 

nname: 6
n 6(None)[params = []
if args:
	params.extend(<genexpr>(args))
if kw:
	params.extend(<genexpr>(kw.items()))
log.warning('  ** self.%s(%s)', attr, ', '.join(params))
]:
	i: 0(t)
	o: 119()

nname: 0
n 0(DEBUG_MODE)[]:
	i: 
	o: 6(t), 119(f)

nname: 0
n 0(None)[if DEBUG_MODE:
	params = []
	if args:
		params.extend(<genexpr>(args))
	if kw:
		params.extend(<genexpr>(kw.items()))
	log.warning('  ** self.%s(%s)', attr, ', '.join(params))
return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75c012c>}
nname: 6
n 6(None)[def __init__(self, obj):
	self._proxy_obj_ = obj

def __getattribute__(self, name):
	if DEBUG_MODE and not CALLS_ONLY:
		log.warning('  ** self.%s.%s', attr, name)
	return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

def __call__(self, *args, **args):
	if DEBUG_MODE:
		params = []
		if args:
			params.extend(<genexpr>(args))
		if kw:
			params.extend(<genexpr>(kw.items()))
		log.warning('  ** self.%s(%s)', attr, ', '.join(params))
	return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb763012c>}
nname: 189
n 189(None)[]:
	i: 138(), 156(), 187(AE)
	o: 

nname: 187
n 187(None)[]:
	i: 146(f)
	o: 189(AE)

nname: 156
n 156(None)[#, e
log.error('  !! self.%s : %s', attr, e)
raise
]:
	i: 146(t)
	o: 189()

nname: 146
n 146(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 27(except)
	o: 156(t), 187(f)

nname: 138
n 138(None)[return attribute
]:
	i: 94(), 117(), 137()
	o: 189()

nname: 137
n 137(None)[]:
	i: 110(t)
	o: 138()

nname: 117
n 117(None)[log.warning('  ** self.%s', attr)
]:
	i: 110(f)
	o: 138()

nname: 110
n 110(CALLS_ONLY)[]:
	i: 30(f)
	o: 117(f), 137(t)

nname: 94
n 94(None)[attribute = ProxyCatcher(attribute)
]:
	i: 30(t)
	o: 138()

nname: 30
n 30('__call__' in dir(attribute))[attribute = object.__getattribute__(self, attr)
class ProxyCatcher(object):
	def __init__(self, obj):
		self._proxy_obj_ = obj

	def __getattribute__(self, name):
		if DEBUG_MODE and not CALLS_ONLY:
			log.warning('  ** self.%s.%s', attr, name)
		return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

	def __call__(self, *args, **args):
		if DEBUG_MODE:
			params = []
			if args:
				params.extend(<genexpr>(args))
			if kw:
				params.extend(<genexpr>(kw.items()))
			log.warning('  ** self.%s(%s)', attr, ', '.join(params))
		return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



]:
	i: 27(try)
	o: 94(t), 110(f)

nname: 27
n 27(None)[]:
	i: 6(), 26()
	o: 30(try), 146(except)

nname: 26
n 26(None)[]:
	i: 0(t)
	o: 27()

nname: 6
n 6(None)[return object.__getattribute__(self, attr)
]:
	i: 0(f)
	o: 27()

nname: 0
n 0(DEBUG_MODE)[]:
	i: 
	o: 6(f), 26(t)

nname: 189
n 189(None)[]:
	i: 138(), 146()
	o: 

nname: 146
n 146(None)[except Exception, e:
	log.error('  !! self.%s : %s', attr, e)
	raise
]:
	i: 30()
	o: 189()

nname: 138
n 138(None)[return attribute
]:
	i: 30()
	o: 189()

nname: 30
n 30(None)[try:
	attribute = object.__getattribute__(self, attr)
	class ProxyCatcher(object):
		def __init__(self, obj):
			self._proxy_obj_ = obj

		def __getattribute__(self, name):
			if DEBUG_MODE and not CALLS_ONLY:
				log.warning('  ** self.%s.%s', attr, name)
			return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

		def __call__(self, *args, **args):
			if DEBUG_MODE:
				params = []
				if args:
					params.extend(<genexpr>(args))
				if kw:
					params.extend(<genexpr>(kw.items()))
				log.warning('  ** self.%s(%s)', attr, ', '.join(params))
			return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



	if '__call__' in dir(attribute):
		attribute = ProxyCatcher(attribute)
	else:
		if not CALLS_ONLY:
			log.warning('  ** self.%s', attr)
]:
	i: 0(try)
	o: 138(), 146()

nname: 0
n 0(None)[if not DEBUG_MODE:
	return object.__getattribute__(self, attr)
]:
	i: 
	o: 30(try)

nname: 189
n 189(None)[]:
	i: 138(), 146()
	o: 

nname: 146
n 146(None)[except Exception, e:
	log.error('  !! self.%s : %s', attr, e)
	raise
]:
	i: 0()
	o: 189()

nname: 138
n 138(None)[return attribute
]:
	i: 0()
	o: 189()

nname: 0
n 0(None)[if not DEBUG_MODE:
	return object.__getattribute__(self, attr)
try:
	attribute = object.__getattribute__(self, attr)
	class ProxyCatcher(object):
		def __init__(self, obj):
			self._proxy_obj_ = obj

		def __getattribute__(self, name):
			if DEBUG_MODE and not CALLS_ONLY:
				log.warning('  ** self.%s.%s', attr, name)
			return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

		def __call__(self, *args, **args):
			if DEBUG_MODE:
				params = []
				if args:
					params.extend(<genexpr>(args))
				if kw:
					params.extend(<genexpr>(kw.items()))
				log.warning('  ** self.%s(%s)', attr, ', '.join(params))
			return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



	if '__call__' in dir(attribute):
		attribute = ProxyCatcher(attribute)
	else:
		if not CALLS_ONLY:
			log.warning('  ** self.%s', attr)
]:
	i: 
	o: 138(), 146()

self.nodes: {0: <unpyclib.structure.node instance at 0xb762adec>, 138: <unpyclib.structure.node instance at 0xb762ef0c>, 146: <unpyclib.structure.node instance at 0xb763b66c>, 189: <unpyclib.structure.node instance at 0xb763b72c>}
nname: 48
n 48(None)[]:
	i: 15(AL), 47()
	o: 

nname: 47
n 47(None)[]:
	i: 18(AF), 25()
	o: 48()

nname: 25
n 25(None)[for cls in args:
setattr(cls, '__getattribute__', _attribute_catcher)
]:
	i: 18(for)
	o: 47()

nname: 18
n 18(None)[]:
	i: 15(loop)
	o: 25(for), 47(AF)

nname: 15
n 15(None)[]:
	i: 6(), 14()
	o: 18(loop), 48(AL)

nname: 14
n 14(None)[]:
	i: 0(t)
	o: 15()

nname: 6
n 6(None)[]:
	i: 0(f)
	o: 15()

nname: 0
n 0(log_level)[]:
	i: 
	o: 6(f), 14(t)

nname: 47
n 47(None)[]:
	i: 18()
	o: 

nname: 18
n 18(None)[for cls in args:
	setattr(cls, '__getattribute__', _attribute_catcher)
]:
	i: 0(loop)
	o: 47()

nname: 0
n 0(None)[if not log_level:
	pass
]:
	i: 
	o: 18(loop)

nname: 47
n 47(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[if not log_level:
	pass
for cls in args:
	setattr(cls, '__getattribute__', _attribute_catcher)
]:
	i: 
	o: 47()

nname: 0
n 0(None)[if not log_level:
	pass
for cls in args:
	setattr(cls, '__getattribute__', _attribute_catcher)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762abec>}
nname: 64
n 64(None)[del _[1]
for stripped_components in components[1:-1]:
stripped_components.insert(0, components[0])
return '.'.join(stripped_components)
]:
	i: 0(AF), 60()
	o: 

nname: 60
n 60(None)[]:
	i: 36(f), 45()
	o: 64()

nname: 45
n 45(None)[continue
]:
	i: 36(t)
	o: 60()

nname: 36
n 36(i)[for i in components[1:-1]:
]:
	i: 0(for)
	o: 45(t), 60(f)

nname: 0
n 0(None)[components = name.split('.')
]:
	i: 
	o: 36(for), 64(AF)

nname: 64
n 64(None)[del _[1]
for stripped_components in components[1:-1]:
stripped_components.insert(0, components[0])
return '.'.join(stripped_components)
]:
	i: 0(AF), 36()
	o: 

nname: 36
n 36(None)[for i in components[1:-1]:
if i:
	continue
]:
	i: 0(for)
	o: 64()

nname: 0
n 0(None)[components = name.split('.')
]:
	i: 
	o: 36(for), 64(AF)

self.nodes: {0: <unpyclib.structure.node instance at 0xb762adec>, 36: <unpyclib.structure.node instance at 0xb762a66c>, 64: <unpyclib.structure.node instance at 0xb763baac>}
nname: 0
n 0(None)[return logging.getLogger(normalize_name(name))
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762a8ac>}
nname: 64
n 64(None)[]:
	i: 49(), 63()
	o: 

nname: 63
n 63(None)[]:
	i: 15(f)
	o: 64()

nname: 49
n 49(None)[pdb.set_trace()
]:
	i: 15(t)
	o: 64()

nname: 15
n 15(stop)[traceback.extract_stack()[-1][1]
traceback.print_exc()
]:
	i: 6(), 14()
	o: 49(t), 63(f)

nname: 14
n 14(None)[]:
	i: 0(t)
	o: 15()

nname: 6
n 6(None)[]:
	i: 0(f)
	o: 15()

nname: 0
n 0(log_level)[]:
	i: 
	o: 6(f), 14(t)

nname: 64
n 64(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[if not log_level:
	pass
traceback.extract_stack()[-1][1]
traceback.print_exc()
if stop:
	pdb.set_trace()
]:
	i: 
	o: 64()

nname: 0
n 0(None)[if not log_level:
	pass
traceback.extract_stack()[-1][1]
traceback.print_exc()
if stop:
	pdb.set_trace()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762aa0c>}
nname: 0
n 0(None)[log.warning(message)
sleep(delay)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb762aaec>}
nname: 290
n 290(None)[def DEBUG(force=False):
	if not force and (not DEBUG_MODE or not log_level):
		pass
	pdb.set_trace()

def TRACE(limit=20):
	if not DEBUG_MODE or not log_level:
		pass
	traceback.print_stack(limit=limit)

def _attribute_catcher(self, attr):
	if not DEBUG_MODE:
		return object.__getattribute__(self, attr)
	try:
		attribute = object.__getattribute__(self, attr)
		class ProxyCatcher(object):
			def __init__(self, obj):
				self._proxy_obj_ = obj

			def __getattribute__(self, name):
				if DEBUG_MODE and not CALLS_ONLY:
					log.warning('  ** self.%s.%s', attr, name)
				return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

			def __call__(self, *args, **args):
				if DEBUG_MODE:
					params = []
					if args:
						params.extend(<genexpr>(args))
					if kw:
						params.extend(<genexpr>(kw.items()))
					log.warning('  ** self.%s(%s)', attr, ', '.join(params))
				return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



		if '__call__' in dir(attribute):
			attribute = ProxyCatcher(attribute)
		else:
			if not CALLS_ONLY:
				log.warning('  ** self.%s', attr)

def WATCH_CLASS(*args):
	if not log_level:
		pass
	for cls in args:
		setattr(cls, '__getattribute__', _attribute_catcher)

def normalize_name(name):
	components = name.split('.')

def GET_LOGGER(name='DEBUG', file=None):
	return logging.getLogger(normalize_name(name))

def PRINT_EXCEPTION(e=None, stop=False):
	if not log_level:
		pass
	traceback.extract_stack()[-1][1]
	traceback.print_exc()
	if stop:
		pdb.set_trace()

def SLOW_PRINT(message='[slow step]', delay=1):
	log.warning(message)
	sleep(delay)

__all__ = ['DEBUG_MODE', 'DEBUG', 'WATCH_CLASS', 'TRACE', 'GET_LOGGER', 'log', 'PRINT_EXCEPTION', 'SLOW_PRINT']
]:
	i: 275(), 289()
	o: 

nname: 289
n 289(None)[]:
	i: 211(f)
	o: 290()

nname: 275
n 275(None)[FILTER(log_filter)
]:
	i: 211(t)
	o: 290()

nname: 211
n 211(log_filter)[log = logging.getLogger('peewee')
DEBUG_MODE = False
CALLS_ONLY = False
class MultiFilter(object):
	def __init__(self, name):
		self.names = name.split('|')

	def filter(self, record):
		for f in self.filters:
			if f.filter(record):
				return 1
				continue
		return 0



def FILTER(name):
	f = MultiFilter(name)
	for h in logging.getLogger().handlers:
		h.filters = [f]

]:
	i: 178(), 210()
	o: 275(t), 289(f)

nname: 210
n 210(None)[]:
	i: 172(f)
	o: 211()

nname: 178
n 178(None)[logging.basicConfig(level=log_level, format=' %(levelname)s.%(threadName)s[%(relativeCreated).8s]  %(name)s::%(filename)s:%(funcName)s:%(lineno)s %(message)s', datefmt='%m-%d %H:%M')
]:
	i: 172(t)
	o: 211()

nname: 172
n 172(log_level)[]:
	i: 158(), 171()
	o: 178(t), 210(f)

nname: 171
n 171(None)[]:
	i: 0&150(f)
	o: 172()

nname: 158
n 158(None)[log_level = logging.ERROR
]:
	i: 0&150(t)
	o: 172()

nname: 0&150
n 0&150(__debug__ and not log_level)[from __future__ import absolute_import
import pdb
from time import asctime, sleep
import traceback
import sys
import logging
import os
log_level = int(os.getenv('DEBUG', logging.NOTSET)) * 10
log_filter = os.getenv('pygui_LOG_FILTER')
]:
	i: 
	o: 158(t), 171(f)

nname: 290
n 290(None)[def DEBUG(force=False):
	if not force and (not DEBUG_MODE or not log_level):
		pass
	pdb.set_trace()

def TRACE(limit=20):
	if not DEBUG_MODE or not log_level:
		pass
	traceback.print_stack(limit=limit)

def _attribute_catcher(self, attr):
	if not DEBUG_MODE:
		return object.__getattribute__(self, attr)
	try:
		attribute = object.__getattribute__(self, attr)
		class ProxyCatcher(object):
			def __init__(self, obj):
				self._proxy_obj_ = obj

			def __getattribute__(self, name):
				if DEBUG_MODE and not CALLS_ONLY:
					log.warning('  ** self.%s.%s', attr, name)
				return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

			def __call__(self, *args, **args):
				if DEBUG_MODE:
					params = []
					if args:
						params.extend(<genexpr>(args))
					if kw:
						params.extend(<genexpr>(kw.items()))
					log.warning('  ** self.%s(%s)', attr, ', '.join(params))
				return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



		if '__call__' in dir(attribute):
			attribute = ProxyCatcher(attribute)
		else:
			if not CALLS_ONLY:
				log.warning('  ** self.%s', attr)

def WATCH_CLASS(*args):
	if not log_level:
		pass
	for cls in args:
		setattr(cls, '__getattribute__', _attribute_catcher)

def normalize_name(name):
	components = name.split('.')

def GET_LOGGER(name='DEBUG', file=None):
	return logging.getLogger(normalize_name(name))

def PRINT_EXCEPTION(e=None, stop=False):
	if not log_level:
		pass
	traceback.extract_stack()[-1][1]
	traceback.print_exc()
	if stop:
		pdb.set_trace()

def SLOW_PRINT(message='[slow step]', delay=1):
	log.warning(message)
	sleep(delay)

__all__ = ['DEBUG_MODE', 'DEBUG', 'WATCH_CLASS', 'TRACE', 'GET_LOGGER', 'log', 'PRINT_EXCEPTION', 'SLOW_PRINT']
]:
	i: 0&150()
	o: 

nname: 0&150
n 0&150(None)[from __future__ import absolute_import
import pdb
from time import asctime, sleep
import traceback
import sys
import logging
import os
log_level = int(os.getenv('DEBUG', logging.NOTSET)) * 10
log_filter = os.getenv('pygui_LOG_FILTER')
if __debug__ and not log_level:
	log_level = logging.ERROR
if log_level:
	logging.basicConfig(level=log_level, format=' %(levelname)s.%(threadName)s[%(relativeCreated).8s]  %(name)s::%(filename)s:%(funcName)s:%(lineno)s %(message)s', datefmt='%m-%d %H:%M')
log = logging.getLogger('peewee')
DEBUG_MODE = False
CALLS_ONLY = False
class MultiFilter(object):
	def __init__(self, name):
		self.names = name.split('|')

	def filter(self, record):
		for f in self.filters:
			if f.filter(record):
				return 1
				continue
		return 0



def FILTER(name):
	f = MultiFilter(name)
	for h in logging.getLogger().handlers:
		h.filters = [f]

if log_filter:
	FILTER(log_filter)
]:
	i: 
	o: 290()

nname: 0&150
n 0&150(None)[from __future__ import absolute_import
import pdb
from time import asctime, sleep
import traceback
import sys
import logging
import os
log_level = int(os.getenv('DEBUG', logging.NOTSET)) * 10
log_filter = os.getenv('pygui_LOG_FILTER')
if __debug__ and not log_level:
	log_level = logging.ERROR
if log_level:
	logging.basicConfig(level=log_level, format=' %(levelname)s.%(threadName)s[%(relativeCreated).8s]  %(name)s::%(filename)s:%(funcName)s:%(lineno)s %(message)s', datefmt='%m-%d %H:%M')
log = logging.getLogger('peewee')
DEBUG_MODE = False
CALLS_ONLY = False
class MultiFilter(object):
	def __init__(self, name):
		self.names = name.split('|')

	def filter(self, record):
		for f in self.filters:
			if f.filter(record):
				return 1
				continue
		return 0



def FILTER(name):
	f = MultiFilter(name)
	for h in logging.getLogger().handlers:
		h.filters = [f]

if log_filter:
	FILTER(log_filter)
def DEBUG(force=False):
	if not force and (not DEBUG_MODE or not log_level):
		pass
	pdb.set_trace()

def TRACE(limit=20):
	if not DEBUG_MODE or not log_level:
		pass
	traceback.print_stack(limit=limit)

def _attribute_catcher(self, attr):
	if not DEBUG_MODE:
		return object.__getattribute__(self, attr)
	try:
		attribute = object.__getattribute__(self, attr)
		class ProxyCatcher(object):
			def __init__(self, obj):
				self._proxy_obj_ = obj

			def __getattribute__(self, name):
				if DEBUG_MODE and not CALLS_ONLY:
					log.warning('  ** self.%s.%s', attr, name)
				return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

			def __call__(self, *args, **args):
				if DEBUG_MODE:
					params = []
					if args:
						params.extend(<genexpr>(args))
					if kw:
						params.extend(<genexpr>(kw.items()))
					log.warning('  ** self.%s(%s)', attr, ', '.join(params))
				return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



		if '__call__' in dir(attribute):
			attribute = ProxyCatcher(attribute)
		else:
			if not CALLS_ONLY:
				log.warning('  ** self.%s', attr)

def WATCH_CLASS(*args):
	if not log_level:
		pass
	for cls in args:
		setattr(cls, '__getattribute__', _attribute_catcher)

def normalize_name(name):
	components = name.split('.')

def GET_LOGGER(name='DEBUG', file=None):
	return logging.getLogger(normalize_name(name))

def PRINT_EXCEPTION(e=None, stop=False):
	if not log_level:
		pass
	traceback.extract_stack()[-1][1]
	traceback.print_exc()
	if stop:
		pdb.set_trace()

def SLOW_PRINT(message='[slow step]', delay=1):
	log.warning(message)
	sleep(delay)

__all__ = ['DEBUG_MODE', 'DEBUG', 'WATCH_CLASS', 'TRACE', 'GET_LOGGER', 'log', 'PRINT_EXCEPTION', 'SLOW_PRINT']
]:
	i: 
	o: 

self.nodes: {'0&150': <unpyclib.structure.node instance at 0xb7624eec>}
from __future__ import absolute_import
import pdb
from time import asctime, sleep
import traceback
import sys
import logging
import os
log_level = int(os.getenv('DEBUG', logging.NOTSET)) * 10
log_filter = os.getenv('pygui_LOG_FILTER')
if __debug__ and not log_level:
	log_level = logging.ERROR
if log_level:
	logging.basicConfig(level=log_level, format=' %(levelname)s.%(threadName)s[%(relativeCreated).8s]  %(name)s::%(filename)s:%(funcName)s:%(lineno)s %(message)s', datefmt='%m-%d %H:%M')
log = logging.getLogger('peewee')
DEBUG_MODE = False
CALLS_ONLY = False
class MultiFilter(object):
	def __init__(self, name):
		self.names = name.split('|')

	def filter(self, record):
		for f in self.filters:
			if f.filter(record):
				return 1
				continue
		return 0



def FILTER(name):
	f = MultiFilter(name)
	for h in logging.getLogger().handlers:
		h.filters = [f]

if log_filter:
	FILTER(log_filter)
def DEBUG(force=False):
	if not force and (not DEBUG_MODE or not log_level):
		pass
	pdb.set_trace()

def TRACE(limit=20):
	if not DEBUG_MODE or not log_level:
		pass
	traceback.print_stack(limit=limit)

def _attribute_catcher(self, attr):
	if not DEBUG_MODE:
		return object.__getattribute__(self, attr)
	try:
		attribute = object.__getattribute__(self, attr)
		class ProxyCatcher(object):
			def __init__(self, obj):
				self._proxy_obj_ = obj

			def __getattribute__(self, name):
				if DEBUG_MODE and not CALLS_ONLY:
					log.warning('  ** self.%s.%s', attr, name)
				return object.__getattribute__(self, '_proxy_obj_').__getattribute__(name)

			def __call__(self, *args, **args):
				if DEBUG_MODE:
					params = []
					if args:
						params.extend(<genexpr>(args))
					if kw:
						params.extend(<genexpr>(kw.items()))
					log.warning('  ** self.%s(%s)', attr, ', '.join(params))
				return object.__getattribute__(self, '_proxy_obj_')(*args, **kw)



		if '__call__' in dir(attribute):
			attribute = ProxyCatcher(attribute)
		else:
			if not CALLS_ONLY:
				log.warning('  ** self.%s', attr)

def WATCH_CLASS(*args):
	if not log_level:
		pass
	for cls in args:
		setattr(cls, '__getattribute__', _attribute_catcher)

def normalize_name(name):
	components = name.split('.')

def GET_LOGGER(name='DEBUG', file=None):
	return logging.getLogger(normalize_name(name))

def PRINT_EXCEPTION(e=None, stop=False):
	if not log_level:
		pass
	traceback.extract_stack()[-1][1]
	traceback.print_exc()
	if stop:
		pdb.set_trace()

def SLOW_PRINT(message='[slow step]', delay=1):
	log.warning(message)
	sleep(delay)

__all__ = ['DEBUG_MODE', 'DEBUG', 'WATCH_CLASS', 'TRACE', 'GET_LOGGER', 'log', 'PRINT_EXCEPTION', 'SLOW_PRINT']
